<!-- 
 - Author : chenyliu.
 - Date   : 2016/9/20.
 - File   : map.uve.vue.
 -->

<template>
  <div :style="{width: mapWidth, height: mapHeight}"></div>
</template>

<script>
  import InitMap from './map.js';
  export default {
    props: {
      mapWidth: {
        type: String,
        default: '0'
      },
      mapHeight: {
        type: String,
        default: '0'
      },
    },
    data() {
      return {
      };
    },
    ready() {
      InitMap('tzAcIFZ5xCoRwm63NcBGfoVB').then(BMap => {
        var map = new BMap.Map(this.$el);
        var currentCity = new BMap.LocalCity();

        currentCity.get(rs => {
          var cityName = rs.name;
          map.centerAndZoom(cityName, 13);
        });
        // 创建地址解析器实例
        var geo = new BMap.Geocoder();
      });
    }
  }
</script>

<style>

</style>